package com.jianzh5.message;

import java.util.Properties;
import java.util.ResourceBundle;

/**
 * 构建邮件配置属性
 * @author jianzh5
 */
public class MailUtil {
	
	private static final ResourceBundle bundle = ResourceBundle.getBundle("smsconf");
	
	public static final String HOST = bundle.getString("mail.host");//服务器地址
	public static final String PROTOCOL = bundle.getString("mail.protocol");//协议
	public static final String PORT =  bundle.getString("mail.port");//端口
	public static final String AUTH = bundle.getString("mail.auth");//是否认证
	public static final String EMAIL = bundle.getString("mail.email");
	public static final String PWD = bundle.getString("mail.password");
	
	//得到邮件属性
	public static Properties getMailProperties(){
		Properties prop = new Properties();
		prop.put("mail.smtp.host", HOST);
		prop.put("mail.store.protocol", PROTOCOL);
		prop.put("mail.smtp.port", PORT);   
		prop.put("mail.smtp.auth", AUTH);  
		return prop;
	}
}
